package cn.youwan.market;

import android.os.Build;
import android.os.Bundle;
import android.annotation.TargetApi;
import android.app.Activity;
import android.content.Intent;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.webkit.WebSettings.LayoutAlgorithm;

@TargetApi(Build.VERSION_CODES.HONEYCOMB)
public class PagerActivity extends Activity {

	private WebView webView;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_pager);
		getActionBar().hide();
		webView = (WebView) findViewById(R.id.pager_web);
		
		Intent intent = getIntent();
		String url = intent.getStringExtra("URL");
		
		webView.setVisibility(WebView.VISIBLE);

		WebSettings ws = webView.getSettings();

		// ws.setUseWideViewPort(true);

		ws.setJavaScriptEnabled(true);

		// wv.addJavascriptInterface(new ContactsPlugin(), "contactsAction");

		// 设置可以支持缩放

		webView.getSettings().setSupportZoom(true);


		// 设置出现缩放工具

		webView.getSettings().setBuiltInZoomControls(true);

		// 让网页自适应屏幕宽度
		WebSettings webSettings = webView.getSettings(); // webView: 类WebView的实例

		webSettings.setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);

		webView.loadUrl(url);
	}
}
